package com.example.baseweather.ui.Instrument;

import android.os.Bundle;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.lifecycle.Observer;
import androidx.lifecycle.ViewModelProvider;

import com.example.baseweather.databinding.ActivityInstrumentPanelBinding;
import com.example.baseweather.domain.MusicInfoBean;
import com.example.baseweather.viewmodel.MediaPlayerViewModel;
import com.example.baseweather.viewmodel.factory.MediaPlayerViewModelFactory;

public class InstrumentPanelActivity extends AppCompatActivity {

    private ActivityInstrumentPanelBinding binding;
    private MediaPlayerViewModel mediaPlayerViewModel;

    //仪表屏幕中间显示媒体组件，组件内上方显示正在播放的媒体
    //信息例如“歌曲名称”“音视频名称”信息栏、“音量显示”。信息
//栏下方显示播放控制按钮，“播放/暂停”“上一曲下一曲”“音量滑
//块”“静音”，在操控设备中点击“播放/暂停”，仪表屏中的按钮随
//之切换“播放/暂停”状态，点击操控设备中的“上一曲下一曲”按钮，
// 仪表屏可切换正在播放媒体信息，点击操控设备中的“静音”按钮， 仪表屏幕“音量显示”调节到静音模式。
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        binding = ActivityInstrumentPanelBinding.inflate(getLayoutInflater());
        setContentView(binding.getRoot());
        mediaPlayerViewModel = new ViewModelProvider(InstrumentPanelActivity.this,
                new MediaPlayerViewModelFactory()).get(MediaPlayerViewModel.class);
        mediaPlayerViewModel.getNextMusic();
        mediaPlayerViewModel.getCurrentMusicInfo().observe(this, new Observer<MusicInfoBean>() {
            @Override
            public void onChanged(MusicInfoBean musicInfoBean) {

            }
        });
    }










}
